perf(continuations): Verify-and-drop continuation epoch proofs instead of collecting them#766
perf(continuations): Verify-and-drop continuation epoch proofs instead of collecting them#766nicole-graus wants to merge 4 commits into
Conversation
|
/ai-review |
Codex Code ReviewFound one issue: Medium - Actionable fix: have I did not run builds or tests, per the review constraints. |
|
Reviewed the streaming verify-and-drop refactor. This is a careful, well-documented change and I found no significant correctness, safety, or performance issues. Verified invariants:
Test coverage is strong — the anti-drift test ( Minor (informational, no action needed): because of the one-epoch lookahead, when a |
AI ReviewPR #766 · 2 changed files Findings
Status column reflects the verdict from the verifier: deepseek-verifier (openrouter/deepseek/deepseek-v4-pro). AI-001: Docstring/doc says "single epoch" but lookahead holds two epoch proofs
Claim The doc (module-level and design doc §8) advertises that the streaming path bounds retained-proof memory to "a single epoch at a time", but the one-epoch lookahead loop in Evidence Lines 975–977: Suggested fix Soften the wording to "bounded to O(1) epochs" or "one epoch in steady state, briefly two across the is_final lookahead" to match the actual retention. AI-002: test_streaming_exactly_two_epochs can panic on zero/one-cycle programs
Claim
Evidence Line 1233 calls Suggested fix Use Reviewer Lanes
Verification Lanes
Native Codex and Claude reviews run separately and post their own comments. They are not included in this structured provenance report. Raw lane outputs, candidates, final issues, and model metrics are uploaded as workflow artifacts. |
…778) - Clarify the private-input guard comment: the parity it buys is with verify_continuation (the standalone verifier); the two-phase composition prove_continuation + verify_continuation instead fails inside Executor::new with Error::Execution before that bound is reached. Add the missing regression test pinning the guard's InvalidTableCounts variant. - Fail loudly (ContinuationInvariant) if resume_with_limit ever returns None mid-run instead of ending the driver cleanly: a clean end would let prove_continuation emit a bundle whose last epoch lacks HALT — never verifiable, with no diagnostic at the cause. Unreachable today (None only occurs with pc == 0 at entry, already guarded), so no behavior change. - Add reciprocal sync notes between verify_continuation's epoch loop and its inline mirror in prove_and_verify_continuation: the differential test only exercises honest proofs, so it cannot catch a rejection check dropped from one of the two copies. - Document the deliberate reg_fini length-guard asymmetry (in-process fini is trusted; a wrong length is an invariant bug that should fail loudly, not be reported as a rejected proof). - Qualify the lookahead comment (positional is_final buys mirror fidelity, not independence from the in-process executor) and the design doc's 'small boundary' claim (boundaries grow with total touched memory; the O(1) bound is on retained proof data).
Motivation
prove_and_verify_continuationproved every epoch and kept all proofs in aVecbefore verifying, so retained proof memory grew with the number of epochs.Description
Verify each epoch inline right after proving it and drop its
MultiProof, keeping only the smallboundary/l2g_root/public_outputneeded for the final global proof. Retained per-epoch proof memory is now O(1) instead of O(#epochs). The epoch loop is extracted into a sharedEpochDriversoprove_continuation(the serialized bundle producer) is unchanged, and the streaming verifier derivesis_final/labelpositionally to stay a faithful mirror ofverify_continuation.